package com.fz;

import sun.swing.plaf.windows.ClassicSortArrowIcon;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class AppCore {
    public static void main(String[] args) throws  Exception{
        Class<?> C = Class.forName("com.fz.CustomerService");
        Object c = C.newInstance();
        Field service = C.getDeclaredField("service");
        service.setAccessible(true);
        Class<?> U = Class.forName("com.fz.UserService");
        service.set(c, new UserService());
        Method say = C.getDeclaredMethod("say");
        say.invoke(c);



    }
}
